<template>
    <view class="page-box">
        <view class="title">
            <view>欢迎您使用</view>
            <view>小朗优创智能匹配系统</view>
        </view>
        <view class="entrance-box">
            <navigator class="entrance row verCenter" url="/pages/productMatch/systemAutomaticMatching" hover-class="none">
                <view class="text">
                    <view class="row">
                        <text class="t1">系统自动匹配</text>
                        <text class="t2">方案入口</text>
                    </view>
                    <view class="t3">根据客户提供的资料系统生成产品方案</view>
                </view>
                <view class="pic">
                    <image src="../../static/b2.png" mode="aspectFill"></image>
                </view>
            </navigator>
            <view class="star-advisor row verCenter">
                <view class="pic">
                    <image src="../../static/b1.png" mode="aspectFill"></image>
                </view>
                <view class="text">
                    <view class="row">
                        <text class="t1">明星顾问</text>
                        <text class="t2">私人订制</text>
                    </view>
                    <view class="t3">汽车金融从业8年以上的专业顾问提供 一对一服务</view>
                </view>
            </view>
        </view>
        <view class="list">
            <navigator class="box row bothSide verCenter" :url="'/pages/productMatch/chat?id='+item.id" hover-class="none" v-for="(item,index) in counselorList" :key="index">
                <view class="left-bar row verCenter">
                    <view class="pic">
                        <image :src="item.photo" mode="aspectFill"></image>
                    </view>
                    <view class="wrap">
                        <view class="text row verCenter">
                            <text class="name">{{item.name}}</text>
                            <view class="stars row verCenter">
                                <image src="../../static/star.png" mode="aspectFill" v-for="(v,i) in item.star" :key="i"></image>
                            </view>
                        </view>
                        <view class="label row verCenter">
                            <view class="box row rowCenter verCenter">从业{{item.year}}年</view>
                            <view class="box row rowCenter verCenter">{{item.star}}星顾问</view>
                        </view>
                    </view>
                </view>
                <view class="btn row rowCenter verCenter">与我互动</view>
            </navigator>
        </view>
    </view>
</template>

<script>
    import { API } from '@/util/api.js';
    export default {
        data() {
            return {
                counselorList: []
            };
        },
        onLoad() {
            this.getData();
        },
        methods: {
            getData() {
                this.request(API.counselorList, 'GET', {}, false).then(res => {
                    if (res.code === 0) {
                        this.counselorList = res.data;
                    } else {
                        uni.showToast({
                            title: res.msg,
                            icon: 'none'
                        });
                    }
                });
            }
        }
    };
</script>

<style scoped lang="scss">
    @import '@/assets/css/productMatch/index.scss';
</style>